﻿Ext.define('Gnt.examples.advanced.view.TaskContextMenu',
{
    extend: 'Gnt.examples.advanced.plugin.TaskContextMenu',
    createMenuItems: function () {
        return this.callParent().concat({
            text: '消息推送',
            handler: this.onMyHandler,
            scope: this
        });
        this.on('beforeshow', this.onMyBeforeShow, this);
    },
    onMyHandler: function () {
        var task = this.rec;
        var win = Ext.create("Gnt.examples.advanced.view.PushMessage", { taskId: task.data.Id });
        win.show();
    },
    onMyBeforeShow: function () {
        var isDeleteAllowed = this.rec.get('AllowDelete');
        this.down('deleteTask').setVisible(isDeleteAllowed);
    }
});
